<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>人事管理系统 ——后台管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>
    <link href="fkjava.ico" rel="shortcut icon" type="image/x-icon"/>

    <script src="../js/a/vue.js"></script>
    <script src="../js/a/axios-0.18.0.js"></script>
    <script src="../js/a/index.js"></script>
    <link rel="stylesheet" href="../css/index.css">
    <script src="../js/a/axios-config.js"></script>
    <style>
        .showCentent {
            /*text-indent: 2em;*/
            width: 80%;
            margin-left: 10%;
        }
        pre{
            white-space: normal;
            word-break: break-all;
            white-space: pre-wrap;
            font-size: 16px;
        }
    </style>

</head>
<body>
<div id="preview">
    <div>
        <center><h1>{{preview.title}}</h1></center>
    </div>
    <br/>
    <div class="showCentent" id="formatContent">
        <pre>{{preview.content}}</pre>
    </div>

</div>

<script>
    new Vue({
        el: '#preview',
        data: {
            preview: {},
            id: 0,
        },
        methods: {
            getUpdateNotice(key) {
                let reg = new RegExp("(^|[&\?])" + key + "=([^&]*)(&|$)");
                let result = window.location.search.match(reg);
                return result ? decodeURIComponent(result[2]) : null;
            },
            initPreview() {
                this.id = this.getUpdateNotice("id")
            },
        },
        mounted() {
            this.initPreview();
            axios.get("/api/notice/list?id=" + this.id)
                .then(resp => {
                    if (resp.data.code == 200) {
                        this.preview = resp.data.data[0];
                    } else if (resp.data.msg) {
                        this.$message.error(resp.data.msg)
                    } else {
                        this.$message.error("系统错误!!!")
                    }
                })
            // this.FormattingContent();
        }
    });
</script>

</body>
</html>